//
// Created by yunnan xu on 2020/11/14.
//

#ifndef ANDROIDGRAPHICSDEMOS_PASS_H
#define ANDROIDGRAPHICSDEMOS_PASS_H

#include <GLES3/gl32.h>
#include <EGL/egl.h>
#include <string>
#include <unordered_map>
#include <vector>
#include "ShaderMgr.h"
#include "GLESUtils.h"

class IRenderItem;

/*
 *  RenderPass 的 抽象类
 * */
class Pass
{
public:
    // 默认为移动构造，不支持拷贝构造
    Pass() = default;
    Pass(const Pass &) = delete;
    Pass & operator=(const Pass &) = delete;
    Pass(Pass &&) = default;
    Pass & operator=(Pass &&) = default;
    virtual ~Pass() = default;
    virtual void InitShaders(std::unordered_map<ShaderType, std::string> shader_dict) = 0;
    virtual void Draw() = 0;

protected:

};


class GLESPass : public Pass
{
public:

    GLESPass();
    virtual ~GLESPass() = default;
    virtual void InitShaders(std::unordered_map<ShaderType, std::string> shader_dict);
    virtual void Draw() = 0;

protected:

    virtual void InitShaderUniformLocation() = 0;

    GLuint program;
    GLuint vertexShader;
    GLuint fragmentShader;
    GLuint computeShader;
};



#endif //ANDROIDGRAPHICSDEMOS_PASS_H
